""" Coding: UTF-8

Project: Code
AUTHOR: lEPUS SHEN
DATE: 2021 年 10 月 02 日

"""

import requests

post_type=input('POST消息类型？text/news\n')
if post_type=='text':
    data = {
        "msgtype": "text",
        "text": {
        "content": "大家好，我是小秘书，欢迎大家加入大家庭哦！",
        "mentioned_list":["xiaoming"],
        "mentioned_mobile_list": ["13456789100"],
        }
    }
    r = requests.post(url='https://qyapi.weixin.qq.com/xxxx', json=data)    #用你自己的Webhook
    print(r.text)

elif post_type=='news':
    data = {
        "msgtype": "news",
        "news": {
            "articles":[
                {
                "title" : "中秋节新闻",
                "description" : "今年中秋节公司有豪礼相送",
                "url" : "http://www.wanplus.com/csgo/team/3243",    #跳转到的链接
                "picurl" : "http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png"   #封面图片
                }
            ]
        }
    }
    r = requests.post(url='https://qyapi.weixin.qq.com/xxxx', json=data)    #用你自己的Webhook
    print(r.text)

